package com.fosss.band.mapper;

import com.fosss.band.entity.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author: fosss
 * Date: 2023/12/27
 * Time: 20:32
 * Description:
 */
@Mapper
public interface MemberMapper {
    Member selectById(@Param("id") Integer id);

    List<Member> selectByBandId(@Param("bandId") Integer bandId);

    void deleteById(@Param("id") Integer id);

    /**
     * 删除成员，直接将成员的离开时间设置上，设置乐队id为负的原id
     */
    void update(@Param("id") Integer id, @Param("leaveTime") Date leaveTime, @Param("bandId") Integer bandId);

    void updateMember(@Param("member") Member member);

    void insert(@Param("member") Member member);
}
